/**
 * Created by chengcong on 2017/12/13.
 */
var url='http://120.27.161.98:6655';
$(function () {
    $.ajax({
        url:url+'/api/WebPage/GetJobFilterList',
        type:'post',
        data:{classid:15},
        success:function (data) {
            $('.phone-personnel-b .row').html('')
            if(data.code==200){
                for(var i=0;i<data.data.length;i++){
                    data.data[i].Requirement=data.data[i].Requirement.split('\r\n').join('<br/>');
                    if(i%2>0){
                        $('.phone-personnel-b .row').append('<div class="col-xs-6">' +
                            '<img style="width:100%" src="http://120.27.161.98:6677/'+data.data[i].jobimg+'" alt="...">' +
                            '</div>' +
                            '<div class="col-xs-6 shuerha">' +
                            '<a href="javascript:void(0)">' +
                            '<img style="width:100%" src="../img/personnel/rencai4.jpg"  onclick="clickdetail(event)" detailid="'+data.data[i].id+'" alt="...">' +
                            '<div class="shuerha1">' +
                            '<h3>'+data.data[i].Position+'</h3>' +
                            '<p style="text-align: left;">' +
                            '<img style="margin-top:0.75rem;" src="../img/personnel/arrow-right-black.png" alt="..."  onclick="clickdetail(event)" detailid="'+data.data[i].id+'">' +
                            '</p>' +
                            '</div>' +
                            '</a>' +
                            '</div>')
                    }else{
                        $('.phone-personnel-b .row').append('<div class="col-xs-6">' +
                            '<img style="width:100%" src="http://120.27.161.98:6677/'+data.data[i].jobimg+'" alt="...">' +
                            '</div>' +
                            '<div class="col-xs-6 shuerha" onclick="clickdetail(event)" detailid="'+data.data[i].id+'">' +
                            '<a href="javascript:void(0)">' +
                            '<img style="width:100%" src="../img/personnel/rencai2.jpg"  onclick="clickdetail(event)" detailid="'+data.data[i].id+'" alt="...">' +
                            '<div class="shuerha1">' +
                            '<h3 style="color:#fff;">'+data.data[i].Position+'</h3>' +
                            '<p style="text-align: left;">' +
                            '<img style="margin-top:0.75rem;" src="../img/personnel/arrow-right-white.png" alt="..." onclick="clickdetail(event)" detailid="'+data.data[i].id+'">' +
                            '</pstyle>' +
                            '</div>' +
                            '</a>' +
                            '</div>')
                    }
                }
                $('.flip-container').on('mouseover',function () {
                    $(this).siblings().css('zIndex','-2')
                });
                $('.flip-container').on('mouseleave',function () {
                    $(this).siblings().css('zIndex','0')
                })
            }
            console.log(data);

        }
    });
})
function clickdetail(e) {
    $.ajax({
        url:url+'/api/WebPage/GetJobFilterList',
        type:'post',
        data:{classid:15},
        success:function (data) {
            if(data.code==200){
                for(var i=0;i<data.data.length;i++){
                    data.data[i].Requirement=data.data[i].Requirement.split('\r\n').join('<br/>');
                    if(data.data[i].id==$(e.target).attr('detailid')){
                        $('.yon-yd-son h1').html(data.data[i].Position);
                        $('.yon-yd-son p').html(data.data[i].Requirement);
                        $('.yon-yd-son a').attr('href',data.data[i].LinkUrl);
                    }
                }
            }
        }
    })
    $('.case-model').show();
    $('.case-model-content').show();
}
function missdiv() {
    $('.case-model').hide();
    $('.case-model-content').hide();
}